import { RegistUser } from "./../login-user"
import { Component, OnInit } from "@angular/core"
import { UserService } from "../user.service"

@Component({
  selector: "app-register",
  templateUrl: "./register.component.html",
  styleUrls: ["./register.component.scss"],
})
export class RegisterComponent implements OnInit {
  model: RegistUser
  codeImgSrc = ""
  constructor(private us: UserService) {
    this.model = new RegistUser()
  }

  ngOnInit(): void {
    this.getCodeImg()
  }

  register() {}
  getCodeImg() {
    this.us.getCodeImg().subscribe({
      next: (e) => {
        this.codeImgSrc = "data:image/png;base64," + e.data
      },
      error: (e) => {
        console.log(e)
      },
    })
  }
}
